import { Form, Input } from 'antd';
import { forwardRef, useImperativeHandle } from 'react';
import PropTypes from 'prop-types';

const AddForm = forwardRef((props, ref) => {
  const [form] = Form.useForm();

  useImperativeHandle(ref, () => ({
    form: form
  }));

  const formItemLayout = { labelCol: { span: 5 }, wrapperCol: { span: 16 } };

  return (
    <Form form={form} name="add-role-form">
      <Form.Item
        label="角色名称"
        {...formItemLayout}
        name="roleName"
        rules={[{ required: true, message: '请输入角色名称' }]}
      >
        <Input type="text" placeholder="请输入角色名称" />
      </Form.Item>
    </Form>
  );
});

AddForm.propTypes = {};

export default AddForm;